﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JYStockAnalyser.Model
{
    /// <summary>
    /// 估值规则
    /// </summary>
    [Serializable]
    public class EstimateRule
    {
        int m_id;
        YearQuarter m_beginYearQuarter;
        YearQuarter m_endYearQuarter;
        List<GuideLineType> m_guideLineTypes;
        Dictionary<string, decimal> m_commonCoefficients;
        Dictionary<string, decimal> m_tradeCoefficients;
        bool m_isDefault;

        decimal m_ASafetyCoefficient;
        decimal m_BSafetyCoefficient;
        decimal m_CSafetyCoefficient;
        decimal m_DSafetyCoefficient;
        decimal m_ESafetyCoefficient;

        public int Id
        {
            get { return m_id; }
            set { m_id = value; }
        }

        public bool IsDefault
        {
            get { return m_isDefault; }
            set { m_isDefault = value; }
        }

        public YearQuarter BeginYearQuarter
        {
            get 
            {
                if (m_beginYearQuarter == null)
                {
                    m_beginYearQuarter = new YearQuarter();
                }
                return m_beginYearQuarter;
            }            
        }

        public YearQuarter EndYearQuarter
        {
            get 
            {
                if (m_endYearQuarter == null)
                {
                    m_endYearQuarter = new YearQuarter();
                }
                return m_endYearQuarter;
            }
        }

        public List<GuideLineType> GuideLineTypes
        {
            get
            {
                if (m_guideLineTypes == null) { m_guideLineTypes = new List<GuideLineType>(); }
                return m_guideLineTypes;
            }  
        }

        public Dictionary<string, decimal> CommonCoefficients
        {
            get
            {
                if (m_commonCoefficients == null)
                {
                    m_commonCoefficients = new Dictionary<string, decimal>();
                }
                return m_commonCoefficients;
            }
        }

        public Dictionary<string, decimal> TradeCoefficients
        {
            get
            {
                if (m_tradeCoefficients == null)
                {
                    m_tradeCoefficients = new Dictionary<string, decimal>();
                }
                return m_tradeCoefficients;
            }
        }

        public decimal ASafetyCoefficient
        {
            get { return m_ASafetyCoefficient; }
            set { m_ASafetyCoefficient = value; }
        }

        public decimal BSafetyCoefficient
        {
            get { return m_BSafetyCoefficient; }
            set { m_BSafetyCoefficient = value; }
        }

        public decimal CSafetyCoefficient
        {
            get { return m_CSafetyCoefficient; }
            set { m_CSafetyCoefficient = value; }
        }

        public decimal DSafetyCoefficient
        {
            get { return m_DSafetyCoefficient; }
            set { m_DSafetyCoefficient = value; }
        }

        public decimal ESafetyCoefficient
        {
            get { return m_ESafetyCoefficient; }
            set { m_ESafetyCoefficient = value; }
        }
    }
}
